<%@page contentType="text/html; charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Fly用户中心</title>
    <link rel="stylesheet" type="text/css" href="../commons/iconfont/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../commons/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="../style/global.css"/>
    <script src="../js/jquery-3.3.1.min.js" type="text/javascript"></script>
    <script src="../commons/layui/layui.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="fly-header layui-bg-black">
    <div class="layui-container"><a class="fly-logo" name="headlink" href="javascript:gotoIndex();"> <img
            src="../img/logo.png"
            alt="layui">
    </a>
        <ul class="layui-nav fly-nav layui-hide-xs">
            <li class="layui-nav-item layui-this"><a href="javascript:gotoIndex();"><i class="iconfont icon-jiaoliu"></i>交流</a>
            </li>
            <li class="layui-nav-item"><a href="javascript:;"><i class="iconfont icon-chanpin"
                                                                 style="top: 1px;"></i>专区<span
                    class="layui-nav-more"></span></a>
                <dl class="layui-nav-child fly-nav-child layui-anim layui-anim-upbit">
                    <dd><a href="/vipclub/list/layuiadmin/">layuiAdmin</a></dd>
                    <hr>
                    <dd><a href="/vipclub/list/layim/">LayIM</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="http://www.layui.com/"><i class="iconfont icon-ui"></i>框架</a></li>
        </ul>
        <ul class="layui-nav fly-nav-user">
            <li class="layui-nav-item"> <a class="fly-nav-avatar" href="https://fly.layui.com/user/" id="LAY_header_avatar">
                <cite class="layui-hide-xs nickName">${currentUser.nickName}</cite> <img src="../upload/${currentUser.headImg}"> <span class="layui-nav-more"></span></a>
                <dl class="layui-nav-child layui-anim layui-anim-upbit">
                    <dd><a href="javascript:gotoUserCenter();">用户中心</a></dd>
                    <dd><a href="javascript:gotoUserAset();">基本设置</a></dd>
                    <hr>
                    <dd><a href="javascript:gotoUserMsg();">我的消息</a></dd>
                    <dd><a href="">已购产品</a></dd>
                    <dd><a href="javascript:gotoUserHomepage(${currentUser.id});">我的主页</a></dd>
                    <hr style="margin: 5px 0;">
                    <dd><a href="https://fly.layui.com/user/logout/" style="text-align: center;">退出</a></dd>
                </dl>
            </li> <span class="layui-nav-bar" style="left: 0px; top: 55px; width: 0px; opacity: 0;"></span>
        </ul>
    </div>
</div>
<div class="layui-container fly-marginTop fly-user-main">
    <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
        <li class="layui-nav-item"><a href="javascript:gotoUserHomepage(${currentUser.id});"> <i class="layui-icon"></i> 我的主页 </a></li>
        <li class="layui-nav-item layui-this"><a href="userCenter.jsp"> <i class="layui-icon"></i> 用户中心 </a>
        </li>
        <li class="layui-nav-item "><a href="javascript:gotoUserAset();"> <i class="layui-icon"></i> 基本设置 </a></li>
        <li class="layui-nav-item "><a href="javascript:gotoUserInvitation();"> <i class="iconfont icon-tiezi"></i> 我的帖子 </a></li>
        <li class="layui-nav-item "><a href="javascript:gotoUserMsg();"> <i class="layui-icon"></i> 我的消息 </a>
        </li>
        <li class="layui-nav-item "><a href="https://fly.layui.com/user/product/"> <i class="iconfont icon-chanpin"></i>
            已购产品 </a></li>
        <li class="layui-nav-item "><a href="https://fly.layui.com/user/extend/"> <i
                class="layui-icon layui-icon-component"></i>
            我的组件 </a></li>
        <span class="layui-nav-bar"></span>
    </ul>
    <div class="site-tree-mobile layui-hide"><i class="layui-icon"></i></div>
    <div class="site-mobile-shade"></div>
    <div class="fly-panel fly-panel-user" pad20="" style="padding-top:20px;">
        <div class="fly-msg" style="margin-bottom: 20px;">Hi,${currentUser.nickName},你已是我们的正式社员。<a
                href="https://fly.layui.com/user/activate/"></a>
        </div>
        <div class="layui-row layui-col-space20">
            <div class="layui-col-md6">
                <div class="fly-panel fly-panel-border">
                    <div class="fly-panel-title"> 我的会员信息</div>
                    <div class="fly-panel-main layui-text" style="padding: 18px 15px; height: 50px; line-height: 26px;">
                        <p> 您的财富经验值：<span id="wealth" style="padding-right: 20px; color: #FF5722;">￥</span> <span
                                id="grade">您当前为：非 VIP</span></p>
                        <p> 您拥有社区飞吻：<span id="kiss" style="color: #FF7200; padding-right: 5px;">飞吻</span> <a
                                href="https://fly.layui.com/order/bill?itemid=16"
                                target="_blank" class="layui-btn layui-btn-warm layui-btn-xs">充值</a></p>
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="fly-panel fly-signin fly-panel-border">
                    <div class="fly-panel-title"> 签到 <i class="fly-mid"></i> <a href="javascript:;" class="fly-link"
                                                                                id="LAY_signinHelp">说明</a>
                        <i class="fly-mid"></i> <a href="javascript:;" class="fly-link" id="LAY_signinTop">活跃榜</a>
                        <span class="fly-signin-days">已连续签到<cite>0</cite>天</span></div>
                    <div class="fly-panel-main fly-signin-main">
                        <button onclick="gotoSign()" class="layui-btn layui-btn-danger" id="LAY_signin">今日签到</button>
                        <span>可获得<cite>5</cite>飞吻</span></div>
                        <input class="signVal" type="hidden" value="${currentUser.id}">
                </div>
            </div>
            <div class="layui-col-md12" style="margin-top: -20px;">
                <div class="fly-panel fly-panel-border">
                    <div class="fly-panel-title"> 快捷方式</div>
                    <div class="fly-panel-main">
                        <ul class="layui-row layui-col-space10 fly-shortcut">
                            <li class="layui-col-sm3 layui-col-xs4"><a href="javascript:gotoUserAset();"><i
                                    class="layui-icon layui-icon-set"></i><cite>修改信息</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4"><a href=""><i
                                    class="layui-icon layui-icon-face-smile"></i><cite>修改头像</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4"><a href="https://fly.layui.com/user/set/#pass"><i
                                    class="layui-icon layui-icon-help"></i><cite>修改密码</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4"><a href="https://fly.layui.com/user/set/#bind"><i
                                    class="layui-icon layui-icon-user"></i><cite>帐号绑定</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4"><a href="javascript:gotoSendPost(${currentUser.id})"><i
                                    class="layui-icon layui-icon-add-circle-fine"></i><cite>发表新帖</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4"><a href="https://fly.layui.com/column/share/"><i
                                    class="layui-icon layui-icon-read"></i><cite>查看分享</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4 LAY_search"><a href="javascript:;"><i
                                    class="layui-icon layui-icon-search"></i><cite>搜索资源</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4"><a
                                    href="https://fly.layui.com/user/post/#collection"><i
                                    class="layui-icon layui-icon-star"></i><cite>我的收藏</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4"><a href="https://fly.layui.com/jie/15697/"><i
                                    class="layui-icon layui-icon-star"></i><cite>成为赞助商</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4"><a href="https://fly.layui.com/jie/2461/"><i
                                    class="layui-icon layui-icon-dialogue"></i><cite>关注公众号</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4"><a href="http://www.layui.com/doc/"><i
                                    class="layui-icon layui-icon-form"></i><cite>文档</cite></a>
                            </li>
                            <li class="layui-col-sm3 layui-col-xs4"><a href="http://www.layui.com/demo/"><i
                                    class="layui-icon layui-icon-template-1"></i><cite>示例</cite></a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="fly-footer">
    <p><a href="http://fly.layui.com/">Fly 社区</a> 2019 © <a href="http://www.layui.com/">layui.com</a></p>
    <p><a href="http://fly.layui.com/jie/3147/" target="_blank">付费计划</a> <a href="https://fly.layui.com/extend/"
                                                                            target="_blank">组件平台</a>
        <a href="https://fly.layui.com/store/" target="_blank">模板市场</a> <a href="https://fly.layui.com/case/2019/"
                                                                           target="_blank">年度案例</a>
        <a href="http://fly.layui.com/jie/2461/" target="_blank">公众号</a></p>
    <div class="fly-union">
        <p style="display: block; margin-bottom: 10px;"><span>感谢以下平台提供云加速支持</span></p>
        <p><a href="https://console.upyun.com/register/?invite=SJ0wu6g2-" target="_blank" rel="nofollow"
              sponsor="upyun">
            <img src="../img/upyun.png"> </a> <a href="https://www.maoyuncloud.com/?from=layui" target="_blank"
                                                 rel="nofollow" sponsor="maoyun"> <img src="../img/168_1559291577683_9348.png"> </a></p>
    </div>
</div>
<script src="../js/index.js" type="text/javascript" charset="utf-8"></script>
<script>
    window.onload = function () {
        $.post('../user/userCenter', {"userId": ${currentUser.id}}, function (result) {
            let data = result.data;
            let grade = data.grade;
            $("#wealth").text("￥" + data.wealth);
            $("#kiss").text(data.kiss);
            var vip = data.grade < 200 ? 1 : (grade > 200 && grade <= 400 ? 2 : (grade > 400 && grade <= 800
                ? 3 : (grade > 800 && grade <= 1500 ? 4 : (grade > 1500 && grade <= 4000 ? 5 : (grade > 4000 && grade <= 8000
                    ? 6 : (grade > 8000 && grade <= 15000 ? 7 : (grade > 15000 && grade <= 50000 ? 8 : (grade > 50000 ? 9 : 0))))))));
            if (vip != 0) {
                $("#grade").text("你当前为:" + "VIP" + vip);
            } else {
                $("#grade").text("你当前为：非VIP")
            }

        });
    };
    layui.use(['util', 'carousel', 'layer', 'element', 'jquery'], function () {
        let util = layui.util,
            carousel = layui.carousel,
            layer = layui.layer,
            element = layui.element,
            $ = layui.jquery;
        //固定块
        util.fixbar({
            bar1: '&#xe642;',
            top:true,
            css: {
                right: 20,
                bottom: 15
            },
            bgcolor: '#009688',
            click: function (type) {
                if (type === 'bar1') {
                    layer.msg('icon是可以随便换的')
                }
            }
        });
        isSign();
    });

    <%--function gotoSign() {--%>
        <%--<c:if test="${empty currentUser}">--%>
        <%--layer.msg("请先登入", {anim: 6});--%>
        <%--return;--%>
        <%--</c:if>--%>
        <%--$.post('../sign/doSign', {"uId": '${currentUser.id}'}, function (ret) {--%>
            <%--console.log(ret.msg);--%>
            <%--if (ret.code == 0) {--%>
                <%--gotoUserCenter();--%>
            <%--}--%>
        <%--});--%>
    <%--}--%>
</script>
<ul class="layui-fixbar">
    <li class="layui-icon" lay-type="bar1" style="background-color:#009688"></li>
    <li class="layui-icon layui-fixbar-top" lay-type="top" style="background-color:#009688"></li>
</ul>
</body>
</html>
